<!DOCTYPE html>
<html>
<head>
    <title>{#:$system_name}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- bootstrap -->
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/bootstrap/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/bootstrap/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/bootstrap/bootstrap-overrides.css" />
    <!-- libraries -->
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/lib/jquery-ui-1.10.2.custom.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/lib/font-awesome.css" />
    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/elements.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/icons.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/compiled/index.css" />
    <!-- 弹窗样式 -->
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/admin/css/admin.css" />
    <link rel="stylesheet" type="text/css" href="{#:STATIC_PATH}/vendor/uploadifive/uploadifive.css">
    <!-- scripts -->
    <script type="text/javascript" src="{#:STATIC_PATH}/admin/js/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="{#:STATIC_PATH}/admin/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="{#:STATIC_PATH}/admin/js/theme.js"></script>
    <!-- 控件JS -->
    <script type="text/javascript" src="{#:STATIC_PATH}/vendor/layer/layer.js"></script>
    <script type="text/javascript" src="{#:STATIC_PATH}/vendor/laypage/laypage.js"></script>
    <script type="text/javascript" src="{#:STATIC_PATH}/vendor/uploadifive/jquery.uploadifive.min.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }
        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
        .table tr td:last-of-type{
            color:#0088cc;
        }
        .table caption{
            font-size: 21px;
            line-height: 60px;
        }
        .table caption span{
            float: left;
        }
        .table caption a{
            display: inline;
            font-size: 20px;
            float: right;
            vertical-align: text-bottom;
            line-height: 60px;
        }
    </style>
<body>
    <!-- 顶部 -->
    <div class="navbar navbar-inverse">
        <div class="navbar-inner">
            <button type="button" class="btn btn-navbar visible-phone" id="menu-toggler">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="brand" href="javascript:;"><img src="{#:STATIC_PATH}/admin/images/logo.png" /></a>
            <ul class="nav pull-right">
                <li class="dropdown">
                    <a href="javascript:;" class="dropdown-toggle hidden-phone" data-toggle="dropdown">
                        {#:session('sess_truename')}
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu" style="z-index: 10000">
                        <li><a href="javascript:passwd()">修改密码</a></li>
                        <li><a href="javascript:logout()">注销</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!-- 左边菜单 -->
    <style type="text/css" media="screen">
        #sidebar-nav .active span{white-space:nowrap;}
    </style>
    <div id="sidebar-nav">
        <ul id="dashboard-menu">
            {#:$system_menu}
        </ul>
    </div>
    <div class="content">
        {#:block name="main"}{#:/block}
    </div>
    <!-- 底部 -->
    <div class="mod-footer">
        <div class="container_box">
            <p class="mod-footer__copyright-text" style="text-align: center;">{#:$copyright_info}</p>
        </div>
    </div>
    <!-- 遮罩层 -->
    <div class="black_bg"  style="display: none"></div>
    <!-- 提示框 -->
    <div id="js_tips" class="page_tips " style="display: none;position: fixed;"><div class="inner"></div></div>
</body>
<script type="text/javascript">
$("#dashboard-menu .active").each(function(){
    var self = $(this);
    $("a[href='javascript:;']",this).click(function(){
        if(self.find("ul")){
            self.find("ul").slideToggle(function(){
                if($(this).hasClass("showUl")){
                    $(this).removeClass("showUl")
                }else{
                    $(this).addClass("showUl")
                }
            });
        }
    });
});
/**
 * 更改密码
 */
function passwd()
{
    layer.prompt({title: '请输入登录新密码，并确认', formType: 1}, function(pass, index){
        if((pass == '') || (pass.length < 6)) {
            msg('新输入六位或六位以上新密码');
        } else {
            $.post("{#:url('entry/passwd')}", {pass:pass}, function(response){
                // console.log(response);return false;
                if(response.status == 1) {
                    layer.close(index);
                }
                msg(response.info, response.status);
            },'json');
        }
    });
}
/**
 * 注销系统
 */
function logout()
{
    layer.confirm('您是否退出系统？', {
        btn: ['确定','取消'] //按钮
    }, function(){
        location.href = "{#:url('login/logout')}";
    }, function(){
        // 取消
    });
}
/**
 * 消息提示
 * @param  {[type]}   msn [消息内容]
 * @param  {[type]}   err [1成功 0失败]
 */
function msg(msn, err)
{
    // 清除之前的信息
    $("#js_tips .inner").html('');
    $("#js_tips").removeClass('success');
    $("#js_tips").removeClass('error');

    // 判断新的消息
    var e = err || 0;
    if(e == 1) {
        $("#js_tips").addClass('success');
    } else {
        $("#js_tips").addClass('error');
    }
    $("#js_tips .inner").html(msn);
    $("#js_tips").show();

    setTimeout(function(){
        $("#js_tips").hide();
        return false;
    }, 3000);
    return false;
}
/**
 * 图片展示
 * @param  {[type]}   src [图片源]
 * @param  {[type]}   alt [注释]
 */
function img(src, alt)
{
    var img = {
        "title": "", //相册标题
        "id": 123, //相册id
        "start": 0, //初始显示的图片序号，默认0
        "data": [   //相册包含的图片，数组格式
            {
                "alt": alt,
                "pid": 666, //图片id
                "src": src, //原图地址
                "thumb": "" //缩略图地址
            }
        ]
    }
    layer.photos({photos: img,anim: 5});
}
// 弹出窗口
function popup_open()
{
    $(".detail").show();
    $(".black_bg").show();
    //遮罩高度
    if($("body").height()>$(window).height()){
        $(".black_bg").css("height",$("body").height()+"px");
    }else{
        $(".black_bg").css("height",$(window).height()+"px");
    };
    // 弹窗加滚轮
    if($(".cont").height()>$(window).height()*0.8){
        $(".cont").css({"height":$(window).height()*0.9+"px","overflow-y":"scroll"});
    }
    // 弹窗 上下居中
    $(".detail").css("margin-top","-"+ ($(".cont").height()/2) +"px");
}
// 关闭窗口
function popup_close()
{
    $(".detail").hide();
    $(".black_bg").hide();
}
// 弹窗显示列表
function alert_list(title, list, area)
{
    layer.open({
        title: title + " - 详情",
        type: 1,
        skin: 'layui-layer-rim', //加上边框
        area: area || ['60%', '80%'], //宽高
        content: '<div style="padding:15px;font-size:15px">' + list + '</div>'
    });
}
//点击菜单改变菜单颜色
$("#dashboard-menu li a").bind({
    "mouseover":function(){
        $(this).css("opacity","1")
    },
    "mouseout":function(){
        if($(this).hasClass('clicked')) {
        } else {
            $(this).css("opacity","");
        }
    },
});
</script>
</html>
